﻿@model TravelWeb.Models.Order

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Order</legend>

        @Html.HiddenFor(model => model.OrderID)

        <div class="editor-label">
            @Html.LabelFor(model => model.CustomerID, "Customer")
        </div>
        <div class="editor-field">
            @Html.DropDownList("CustomerID", String.Empty)
            @Html.ValidationMessageFor(model => model.CustomerID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.TourID, "Tour")
        </div>
        <div class="editor-field">
            @Html.DropDownList("TourID", String.Empty)
            @Html.ValidationMessageFor(model => model.TourID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ScheduleID, "Schedule")
        </div>
        <div class="editor-field">
            @Html.DropDownList("ScheduleID", String.Empty)
            @Html.ValidationMessageFor(model => model.ScheduleID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PaymentType)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.PaymentType)
            @Html.ValidationMessageFor(model => model.PaymentType)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.numOfAdult)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.numOfAdult)
            @Html.ValidationMessageFor(model => model.numOfAdult)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.numOfChild)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.numOfChild)
            @Html.ValidationMessageFor(model => model.numOfChild)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.TotalPrice)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TotalPrice)
            @Html.ValidationMessageFor(model => model.TotalPrice)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.PromotionID, "Promotion")
        </div>
        <div class="editor-field">
            @Html.DropDownList("PromotionID", String.Empty)
            @Html.ValidationMessageFor(model => model.PromotionID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.OrderDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.OrderDate)
            @Html.ValidationMessageFor(model => model.OrderDate)
        </div>
        
        @Html.HiddenFor(model => model.Status)

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
